package org.feng.utils;

import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.util.AntPathMatcher;

import java.util.List;

/**
 * @Author feng
 * @Date 2022/3/10 10:28
 * @Description TODO
 */
public class StringUtil {

    /**
     * 匹配路径
     *
     * @param path    请求路径
     * @param exclude 排序得路径列表
     * @return
     */
    public static Boolean matchers(String path, List<String> exclude) {
        AntPathMatcher antPathMatcher = new AntPathMatcher();
        for (String pattern : exclude) {
            if (antPathMatcher.match(pattern, path)) {
                return true;
            }
        }
        return false;
    }
}
